<!DOCTYPE html>
<!-- saved from url=(0062)https://mgz0227.github.io/The-tutorial-of-Legado/Rule/rss.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<meta name="viewport" content="width=device-width initial-scale=1">
    <meta name="description" content="阅读3.0（Legado）教程,阅读3.0教程,订阅源教程">
	<meta name="keywords" content="阅读3.0（Legado）教程,阅读3.0订阅源教程,legado订阅源教程">
	<title>订阅源规则：从入门到再入门</title>
	<link rel="icon" href="https://cdn.jsdelivr.net/gh/celetor/SourceGo@main/icon2.jpg">
	<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body class="typora-export os-windows">
<div id="write" class=""><h2><a name="legado订阅源规则说明" class="md-header-anchor"></a><span>Legado订阅源规则说明</span></h2><p><span>更新时间：2024-02-27</span></p><h3><a name="概况" class="md-header-anchor"></a><span>概况</span></h3><ul><li><span>1、语法说明</span></li><li><span>2、Legado的特殊规则</span></li><li><span>3、解析流程</span></li><li><span>4、规则概述</span></li><li><span>5、附录</span></li></ul><hr><h3><a name="1语法说明" class="md-header-anchor"></a><span>1、语法说明</span></h3><ul><li><span>详见</span><a href="https://alanskycn.gitee.io/teachme/"><span>书源规则</span></a>（已404）</li></ul><h3><a name="2legado的特殊规则" class="md-header-anchor"></a><span>2、Legado的特殊规则</span></h3><ul><li><span>详见</span><a href="https://alanskycn.gitee.io/teachme/"><span>书源规则</span></a>（已404）</li></ul><h3><a name="3解析流程" class="md-header-anchor"></a><span>3、解析流程</span></h3><ul><li><p><span>订阅源的解析</span></p><ol start=""><li><p><span>访问</span><code>源URL(sourceUrl)</code></p></li><li><p><span>检查是否存在</span><code>列表规则(ruleArticles)</code></p><p><span>若为空，则认为是标准RSS源，采用默认规则解析。否则，请看第3点。</span></p></li><li><p><span>解析</span><code>列表规则(ruleArticles)</code></p><p><span>返回一个列表，</span><code>列表下一页规则(ruleArticles)</code><span>只在上拉时触发，且不存在页数</span><code>{{page}}</code></p></li><li><p><span>解析</span><code>标题规则(ruleTitle)</code><span>、</span><code>时间规则(rulePubDate)</code><span>、</span><code>图片url规则(ruleImage)</code><span>、</span><code>链接规则(ruleLink)</code><span>和</span><code>链接规则(ruleLink)</code></p></li><li><p><span>检查是否存在</span><code>描述规则(ruleDescription)</code></p><p><span>若存在，则解析</span><code>描述规则(ruleDescription)</code><span>，到这里就解析结束。否则，请看第6点。</span></p></li><li><p><span>检查是否存在</span><code>内容规则(ruleContent)</code></p><p><span>若存在，则解析</span><code>内容规则(ruleContent)</code><span>，然后结束解析。否则，直接结束解析。</span></p></li></ol></li><li><p><span>根据订阅源的解析，可以发现订阅源有三种：标准RSS源、有列表规则和描述规则的源以及有列表规则无描述规则的源。</span><span>	</span></p><p><span>▲ 标准RSS源</span></p><ul><li><span>特征：只填写了</span><code>源名称(sourceName)</code><span>、</span><code>源URL(sourceUrl)</code><span>。</span></li><li><code>图标(sourceIcon)</code><span>和</span><code>源分组(sourceGroup)</code><span>可有可无，不影响解析。</span></li></ul><p><span>▲ 有列表规则和描述规则的源</span></p><ul><li><span>特征：一定填写了</span><code>源名称(sourceName)</code><span>、</span><code>源URL(sourceUrl)</code><span>、</span><code>列表规则(ruleArticles)</code><span>、</span><code>标题规则(ruleTitle)</code><span>、</span><code>描述规则(ruleDescription)</code><span>和</span><code>链接规则(ruleLink)</code><span>。</span></li><li><code>列表下一页规则(ruleArticles)</code><span>根据实际需求来填写，不填也可以。</span><code>图标(sourceIcon)</code><span>和</span><code>源分组(sourceGroup)</code><span>可有可无，不影响解析。</span></li></ul><p><span>▲ 有列表规则无描述规则的源</span></p><ul><li><span>特征：一定填写了</span><code>源名称(sourceName)</code><span>、</span><code>源URL(sourceUrl)</code><span>、</span><code>列表规则(ruleArticles)</code><span>、</span><code>标题规则(ruleTitle)</code><span>和</span><code>链接规则(ruleLink)</code><span>。</span></li><li><code>列表下一页规则(ruleArticles)</code><span>和</span><code>内容规则(ruleContent)</code><span>根据实际需求来填写，不填也可以。</span><code>图标(sourceIcon)</code><span>和</span><code>源分组(sourceGroup)</code><span>可有可无，不影响解析。</span></li></ul></li></ul><h3><a name="4规则概述" class="md-header-anchor"></a><span>4、规则概述</span></h3><ul><li><p><span>源URL(sourceUrl)</span></p><ul><li><span>必填</span></li><li><span>唯一标识，不可重复</span></li><li><span>与其他源相同会覆盖</span></li></ul></li><li><p><span>源名称(sourceName)</span></p><ul><li><span>必填</span></li><li><span>名字可重复</span></li></ul></li><li><p><span>图标(sourceIcon)</span></p><ul><li><span>可不填</span></li></ul></li><li><p><span>源分组(sourceGroup)</span></p><ul><li><span>可不填</span></li></ul></li><li><p><span>列表规则(ruleArticles)</span></p><ul><li><span>根据实际需求填写</span></li><li><span>判断是否是标准RSS的标志</span></li></ul></li><li><p><span>列表下一页规则(ruleArticles)</span></p><ul><li><span>根据实际需求填写，一般和</span><code>列表规则(ruleArticles)</code><span>一起搭配使用</span></li><li><span>规则解析的结果必须是字符串</span></li><li><span>无页数</span><code>{{page}}</code><span>，想实现页数加一请使用JS</span></li></ul></li><li><p><span>标题规则(ruleTitle)</span></p><ul><li><span>填写</span><code>列表规则(ruleArticles)</code><span>后，为必填项</span></li></ul></li><li><p><span>时间规则(rulePubDate)</span></p><ul><li><span>可不填，根据实际需求填写</span></li></ul></li><li><p><span>描述规则(ruleDescription)</span></p><ul><li><span>根据实际需求填写</span></li><li><span>区分</span><code>有列表规则和描述规则的源</code><span>和</span><code>有列表规则无描述规则的源</code><span>的标志</span></li></ul></li><li><p><span>图片url规则(ruleImage)</span></p><ul><li><span>可不填，根据实际需求填写</span></li></ul></li><li><p><span>链接规则(ruleLink)</span></p><ul><li><span>填写</span><code>列表规则(ruleArticles)</code><span>后，为必填项</span></li><li><span>文章的唯一标识</span></li></ul></li><li><p><span>内容规则(ruleContent)</span></p><ul><li><span>根据实际需求填写，不填打开网页，填写可修改样式</span></li></ul></li><li><p><span>请求头(header)</span></p><ul><li><span>根据实际需求填写</span></li></ul></li></ul><h3><a name="5附录" class="md-header-anchor"></a><span>5、附录</span></h3><ul><li><p><span>订阅源</span></p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "articleStyle": 0,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "customOrder": -24967,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "enableJs": true,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "enabled": true,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "enabledCookieJar": false,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "header": {\n\"User-Agent\": \"Mozilla/5.0 (Linux; U; Android 8.1.0; zh-CN; MI 8 Lite Build/OPM1.171019.019) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 UCBrowser/13.2.0.1100 Mobile Safari/537.36\"\n}",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "lastUpdateTime": 1675946926480,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "loadWithBaseUrl": true,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "ruleArticles": "id.content@h3",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "ruleLink": "a@href",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "ruleTitle": "a@textNodes",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "singleUrl": true,</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "sortUrl": "首页::http://yuedu.miaogongzi.net/gx.html",</span></pre>	
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "sourceGroup": "书源",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "sourceIcon": "https://i.loli.net/2021/06/23/S7rvWRZtPIq34MJ.png",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "sourceName": "喵公子书源管理",</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  "sourceUrl": "http://yuedu.miaogongzi.net/gx.html"</span></pre>
	<pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 368px;"></div><div class="CodeMirror-gutters" style="display: none; height: 368px;"></div></div></div></pre></li></ul><p>&nbsp;</p></div>


</body></html>